package com.spsoft.system.controller;


import com.spsoft.core.annotation.AnonymousAccess;
import com.spsoft.core.annotation.Log;
import com.spsoft.core.controller.BaseController;

import com.spsoft.core.enums.LogActionType;
import com.spsoft.core.enums.LogMenuEnum;

import com.spsoft.core.model.Result;


import com.spsoft.system.model.vo.SysRolesVo;
import com.spsoft.system.service.SysRolesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 角色
 * </p>
 *
 * @author dlchen
 * @since 2023-11-16
 */
@Api(tags = {"角色管理 "})
@RestController
@RequestMapping("/sysRoles")
@RequiredArgsConstructor
@Validated
@Slf4j
public class SysRolesController extends BaseController {

    private final SysRolesService sysRolesService;
    @ApiOperation("获取全部角色")
    @AnonymousAccess(value = "/getAllSysRoles", method = RequestMethod.GET,permissionCode = "")
    @Log(value = "获取全部角色", type = LogActionType.SELECT,  menuName = LogMenuEnum.SYSTEM_BASIC_INFO)
    public Result<List<SysRolesVo>> getAllSysRoles() {
        return sysRolesService.getAllSysRoles();
    }
}

